package com.ruoyi.bizsys.service.impl;

import java.util.List;
import java.util.Arrays;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.bizsys.domain.LoanOrderErrorLog;
import com.ruoyi.bizsys.mapper.LoanOrderErrorLogMapper;
import com.ruoyi.common.utils.DateUtils;
            import org.springframework.stereotype.Service;
import com.ruoyi.bizsys.service.ILoanOrderErrorLogService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;


/**
 * 提现异常Service业务层处理
 *
 * @author african-loan
 * @date 2021-12-30
 */
@Service
public class LoanOrderErrorLogServiceImpl extends ServiceImpl<LoanOrderErrorLogMapper,LoanOrderErrorLog> implements ILoanOrderErrorLogService {

    /**
     * 查询提现异常
     *
     * @param id 提现异常ID
     * @return 提现异常
     */
    @Override
    public LoanOrderErrorLog selectLoanOrderErrorLogById(Long id) {
        return this.getById(id);
    }

    /**
     * 查询提现异常列表
     *
     * @param loanOrderErrorLog 提现异常
     * @return 提现异常
     */
    @Override
    public List<LoanOrderErrorLog> selectLoanOrderErrorLogList(LoanOrderErrorLog loanOrderErrorLog) {
        return this.list(new QueryWrapper<>(loanOrderErrorLog).last("order by id desc"));
    }

    /**
     * 新增提现异常
     *
     * @param loanOrderErrorLog 提现异常
     * @return 结果
     */
            @Override
    public int insertLoanOrderErrorLog(LoanOrderErrorLog loanOrderErrorLog) {
                                                                                                                                                                                                                                                                                                                                                                    loanOrderErrorLog.setCreateTime(DateUtils.getNowDate());
                            return baseMapper.insert(loanOrderErrorLog);
    }

    /**
     * 修改提现异常
     *
     * @param loanOrderErrorLog 提现异常
     * @return 结果
     */
            @Override
    public int updateLoanOrderErrorLog(LoanOrderErrorLog loanOrderErrorLog) {
                                                                                                                                                                                                                                                                                                                                                                    return baseMapper.updateById(loanOrderErrorLog);
    }

    /**
     * 批量删除提现异常
     *
     * @param ids 需要删除的提现异常ID
     * @return 结果
     */
            @Override
    public int deleteLoanOrderErrorLogByIds(Long[] ids) {
        return baseMapper.deleteBatchIds(Arrays.asList(ids));
    }

    /**
     * 删除提现异常信息
     *
     * @param id 提现异常ID
     * @return 结果
     */
    @Override
    public int deleteLoanOrderErrorLogById(Long id) {
        return baseMapper.deleteById(id);
    }

}
